﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Carrot.Core.Logging
{
    /// <summary>
    /// It represents an <see cref="ILogger"/> implementation which does nothing.
    /// </summary>
    public class NullLogger : ILogger
    {
        private static NullLogger _instance = new NullLogger();

        /// <summary>
        /// Gets the instance of <see cref="NullLogger"/>
        /// </summary>
        /// <value>The instance.</value>
        public static ILogger Instance
        {
            get
            {
                return _instance;
            }
        }

        private NullLogger()
        { 
        }

        #region ILogger Members

        /// <summary>
        /// Check whether the logger is able to log for this <para>level</para>.
        /// </summary>
        /// <param name="level">The type of logging information</param>
        /// <returns></returns>
        public bool IsEnabled(LogLevel level)
        {
            return true;
        }

        /// <summary>
        /// Do logging information.
        /// </summary>
        /// <param name="level">The type of logging information</param>
        /// <param name="ex">The occurred exception</param>
        /// <param name="formatProvider">The format provider</param>
        /// <param name="format">The format string of logging message</param>
        /// <param name="parameters">Parameters should be passed for formatting</param>
        public void Log(LogLevel level, Exception ex, IFormatProvider formatProvider, string format, params object[] parameters)
        {
        }

        #endregion
    }
}
